/*
 * Node.h
 *
 *  Created on: Aug 1, 2012
 *      Author: adroaldo
 */

#ifndef NODE_H_
#define NODE_H_
#include<config.h>

enum state {
	DESOCUPADO, ESTACIONARIO, ESTA_NO_VARAL, TEM_TOKEN, MONITORAMENTO, SOLICITANTE,
};
class node {

	nsaddr_t pred;          /*Endereco de predecessor*/
	nsaddr_t succ;          /*Endereco de sucessor*/
	nsaddr_t ring_address;  /*Endereco do anel*/
	nsaddr_t i_node;          /*Endereco do nó*/
	nsaddr_t vpred;         /*Provavel endereco de predecessor no varal*/
	nsaddr_t vsucc;         /*Provavel endereco de sucessor no varal*/
	nsaddr_t vring_address; /*Provavel endereco de varal*/

	state my_state;
	state my_prev_state;
	state my_before_prev_state;
	/**/
public:
	node(nsaddr_t id);
	virtual ~node();
    state getMy_before_prev_state() const;
    state getMy_prev_state() const;
    state getMy_state() const;
    nsaddr_t getNode_address() const;
    nsaddr_t getPred() const;
    nsaddr_t getRing_address() const;
    nsaddr_t getSucc() const;
    nsaddr_t getVpred() const;
    nsaddr_t getVring_address() const;
    nsaddr_t getVsucc() const;
    void setMy_before_prev_state(state my_before_prev_state);
    void setMy_prev_state(state my_prev_state);
    void setMy_state(state my_state);
    void setNode_address(nsaddr_t i_node);
    void setPred(nsaddr_t pred);
    void setRing_address(nsaddr_t ring_address);
    void setSucc(nsaddr_t succ);
    void setVpred(nsaddr_t vpred);
    void setVring_address(nsaddr_t vring_address);
    void setVsucc(nsaddr_t vsucc);
};

#endif /* NODE_H_ */
